package com.lyf.boot.listener;

import com.lyf.boot.constant.RabbitMqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Luyufan
 * @date 2023/7/10 18:03
 */
@Component
@Slf4j
public class PublishMessageListener {

    @RabbitListener(queues = RabbitMqConstant.PUBLISH_QUEUE_ONE)
    public void receive1(String message){
        log.info("receiver1:{}", message);
    }

    @RabbitListener(queues = RabbitMqConstant.PUBLISH_QUEUE_TWO)
    public void receive2(String message){
        log.info("receiver2:{}", message);
    }
}
